package com.jdz.gxq.info.admin.loan.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.jdz.gxq.info.admin.loan.bo.Loan;
import com.jdz.gxq.info.admin.loan.form.EditLoanForm;
import com.jdz.gxq.info.admin.loan.service.LoanService;
import com.jdz.gxq.info.common.action.CommonAction;

public class EditLoanAction extends CommonAction {

	private LoanService loanService = null;
	 
	public ActionForward doExecute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws java.lang.Exception {
		
		EditLoanForm editLoanForm = (EditLoanForm) form;
	
		Loan loan = loanService.getLoanById(editLoanForm.getId());
		
		editLoanForm.setLoan(loan);

		return mapping.findForward("success");
	}

	public void setLoanService(LoanService loanService) {
		this.loanService = loanService;
	}
}

